/* 
 *   Date       Developer   Description
 *   
 *
 *   Classname:  zzz.test.eip.filter.Test
 * 
 *   Date:   2014-3-13
 * 
 *   The source code contained in this listing is proprietary to
 *   HLJ POST YITONG INFO-NET CO.,LTD.
 * 
 *   Unauthorized copying, adaptation, distribution, use, or display
 *   is strictly prohibited.
 *   This software is Copyright 2014 HLJ POST YITONG INFO-NET CO.,LTD.
 */
package com.titan.demo.camel.sample.eip.filter;

import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;


/**
 *
 *
 * @author Administrator
 *
 */
public class Test02 {

    public static void main(String[] args) {
        try {
            RouteBuilder builder = new RouteBuilder() {
                public void configure() throws Exception {
                    // 根据输入1或者2，进行不同的处理
                    from("stream:in?promptMessage=Enter something: ")
                    .filter("javaScript", "1==1").process(new Processor() {
                            public void process(Exchange exchange) throws Exception {
                                System.out.println("0000000000000");
                            }                            
                        });
                }
            };
            
            CamelContext context = new DefaultCamelContext();
            context.addRoutes(builder);
            context.start();
            
            Thread.sleep(60 * 1000);
            context.stop();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

